#include "material.h"

using namespace PBVP;

Material& Material::operator = (const Material& m)
{
	m_Ambient = m.m_Ambient;
	m_Diffuse = m.m_Diffuse;
	m_Specular = m.m_Specular;
	m_Emission = m.m_Emission;
	m_Shiness = m.m_Shiness;

	return *this;
}

void Material::apply(GLenum face)
{
	glMaterialfv(face, GL_AMBIENT, ambient().ptr());
	glMaterialfv(face, GL_DIFFUSE, diffuse().ptr());
	glMaterialfv(face, GL_SPECULAR, specular().ptr());
	glMaterialfv(face, GL_EMISSION, emission().ptr());
	glMaterialf(face, GL_SHININESS, shiness());
}
